#include "common.h"

int main(int argc, char *argv[]){
	char *line = "Test Line";
	char *source_name_to_print = "NEWTON.PAS";
	char date_to_print[DATE_STRING_LENGTH]={'\0'};
	print_line(line, source_name_to_print, date_to_print);
	return 0;
}

void print_line(char line[], char source_name_to_print[], char date_to_print[]){
   char save_char[1] ={'\0'};
   char *save_char_ptr = NULL;
   static int line_count = MAX_LINES_PER_PAGE;
   line_count=line_count+1;
   
   if(line_count > MAX_LINES_PER_PAGE){
       //print_page_header(source_name_to_print, date_to_print);
       line_count=1;
   }
   if(sizeof(line)/sizeof(char *) > MAX_PRINT_LINE_LENGTH){
       save_char_ptr = &line[sizeof(line)/sizeof(char *)-1];
   }
   if(save_char_ptr != NULL){
       strcpy(save_char, save_char_ptr);
       save_char_ptr = '\0';
   }
   printf("%s",line);
   if(save_char_ptr != NULL){
       save_char_ptr = save_char;
   }
}
